﻿using System;
using Microsoft.Extensions.DependencyInjection;
using EaseDapper.Providers.ExpressionBuilderProvider;

namespace EaseDapper
{
    public static class RegistryDatabase
    {
        public static void AddDataManager(this IServiceCollection services, Action<DatabaseOptionsBuilder> optionsAction)
        {
            optionsAction.Invoke(new DatabaseOptionsBuilder());
            services.AddSingleton<IDataManager>(new DataManagerClient(GlobalDatas.Config));
        }

    }
}
